package com.atguigu.springcloud.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 指定Feign接口调用方法默认降级配置
 *
 * @author Tu
 * @date 2023/6/24 17:17
 */
@Component
@FeignClient(value = "cloud-eureka-hystrix", fallback = PaymentFollBackService.class)
public interface PaymentHystrixService {

    /**
     * 支付信息成功接口
     *
     * @param id
     * @return
     */
    @GetMapping("/api/v1/payment/hystrix/ok/{id}")
    String paymentInfoSuccess(@PathVariable("id") Integer id);

    /**
     * 支付信息异常接口
     *
     * @param id
     * @return
     */
    @GetMapping("/api/v1/payment/hystrix/error/{id}")
    String paymentInfoError(@PathVariable("id") Integer id);

}
